Skip to content

Carry each frame's timestamp across the shmem ring - #15

Merged
cboulay merged 1 commit into
mainfrom
feat/shmem-frame-times
Oct 15, 2026
Merged

cboulay merged 1 commit into
mainfrom
feat/shmem-frame-times

Conversation

@cboulay

@cboulay cboulay commented Oct 15, 2026

Copy link
Copy Markdown
Member

The shmem ring carried samples only, so ShmemSweepWidget pushed data to phosphor with no timestamps. Sweep events, such as marker lines, then had no clock to align against.

  • Timestamps in the ring: the data segment now leads with one float64 timestamp per frame, the buffered axis's value for that frame. It is written before write_index advances, so a reader takes frames and their times from the same slots. ring_views() defines the layout once, and both the writer and the reader use it.
  • Format version: the shmem struct version goes to 2. Both ends must run the same ezmsg-tools version, as before; the reader rejects a mismatch loudly.
  • New EZShmMirror.timed_view(): returns (frames, times, overflow). auto_view() is unchanged.
  • ShmemSweepWidget passes the times to phosphor's push_data.

The new test drives the sink in-process, without ez.run, through a ring wrap, and checks that every frame read back carries the time it was sent with.

Pairs with ezmsg-org/phosphor#11. It doesn't require that PR, but its event placement is what uses these times.

The data segment now leads with one float64 timestamp per frame (the
buffered axis's value), written before write_index advances, so a reader
takes frames and their times from the same slots. Struct version 2.
EZShmMirror.timed_view() returns (frames, times, overflow); auto_view is
unchanged. ShmemSweepWidget passes the times to phosphor's push_data, so
sweep events can be placed on the stream's own clock.
@cboulay
cboulay merged commit 7ab4894 into main Oct 15, 2026
11 checks passed
@cboulay
cboulay deleted the feat/shmem-frame-times branch October 15, 2026 05:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant